#pragma once


#include <memory>
#include "log_family.hpp"

class ILogFactory {
public:
    virtual ~ILogFactory() = default;
    virtual std::unique_ptr<ILogFormatter> createJson() = 0;
    virtual std::unique_ptr<ILogFormatter> createCsv() = 0;
    virtual std::unique_ptr<ILogFormatter> createXml() = 0;
};

class ConsoleLogFactory : public ILogFactory {
public:
    ConsoleLogFactory(const ConsoleLogFactory&) = delete;
    ConsoleLogFactory& operator=(const ConsoleLogFactory&) = delete;
    static ConsoleLogFactory& instance();
    std::unique_ptr<ILogFormatter> createJson() override;
    std::unique_ptr<ILogFormatter> createCsv()  override;
    std::unique_ptr<ILogFormatter> createXml()  override;
private:
    ConsoleLogFactory() = default;
};

class FileLogFactory : public ILogFactory {
public:
    FileLogFactory(const FileLogFactory&) = delete;
    FileLogFactory& operator=(const FileLogFactory&) = delete;
    static FileLogFactory& instance();
    std::unique_ptr<ILogFormatter> createJson() override;
    std::unique_ptr<ILogFormatter> createCsv()  override;
    std::unique_ptr<ILogFormatter> createXml()  override;
private:
    FileLogFactory() = default;
};